<?php


namespace app\admin\validate;


use think\Validate;

class UserLevel extends Validate
{
    protected $rule = [
        'name'              =>  'require|unique:user_level',
        'jq_jl_bili'        =>  'require|float',
        'jl_bili'           =>  'require|float',
        'cbj_sf_bl'           =>  'require|float',
        'pj_jl'           =>  'require|float',
        'lj_ry_yeji'        =>  'requireIf:lj_ry_open,1|float',
        'td_ry_yeji'        =>  'requireIf:td_ry_yeji_open,1|float',
        'dsc_ry_yeji'        =>  'requireIf:dsc_ry_yeji_open,1|float',
        'market_num'        =>  'requireIf:update_open,1|number',
        'num'               =>  'requireIf:update_open,1|number',
        'fh_lj_ry_yeji'        =>  'requireIf:fh_lj_ry_open,1|float',
        'fh_td_ry_yeji'        =>  'requireIf:fh_td_ry_yeji_open,1|float',
        'fh_dsc_ry_yeji'        =>  'requireIf:fh_dsc_ry_yeji_open,1|float',
        'fh_market_num'        =>  'requireIf:fh_update_open,1|number',
        'fh_num'               =>  'requireIf:fh_update_open,1|number',
    ];
    protected $message = [
        'name.require'           => '请输入等级名称',
        'name.unique'            => '等级名称已存在',
        'jq_jl_bili.require'       => '请输入加权奖励比例,不需要填写0!',
        'jq_jl_bili.float'         => '加权奖励比例只能为数字',
        'jl_bili.require'       => '请输入团队分红奖励比例,不需要填写0!',
        'jl_bili.float'         => '团队分红奖励比例只能为数字',
        'cbj_sf_bl.require'       => '请输入储备金释放比例,不需要填写0!',
        'cbj_sf_bl.float'         => '储备金释放比例只能为数字',
        'pj_jl.require'       => '请输入平级奖励比例,不需要填写0!',
        'pj_jl.float'         => '平级奖励比例只能为数字',
        'lj_ry_yeji.requireIf'       => '请输入累计认养金额,不需要填写0!',
        'lj_ry_yeji.float'         => '累计认养金额只能为数字',
        'td_ry_yeji.requireIf'       => '请输入团队认养业绩,不需要填写0!',
        'td_ry_yeji.float'         => '团队认养业绩只能为数字',
        'dsc_ry_yeji.requireIf'       => '请输入大市场认养业绩,不需要填写0!',
        'dsc_ry_yeji.float'         => '大市场认养业绩只能为数字',
        'market_num.requireIf'       => '请输入所需市场数,不需要填写0!',
        'market_num.number'         => '所需市场数只能为数字',
        'num.requireIf'       => '请输入人数,不需要填写0!',
        'num.number'         => '人数只能为数字',
        'fh_lj_ry_yeji.requireIf'       => '请输入累计认养金额,不需要填写0!',
        'fh_lj_ry_yeji.float'         => '累计认养金额只能为数字',
        'fh_td_ry_yeji.requireIf'       => '请输入团队认养业绩,不需要填写0!',
        'fh_td_ry_yeji.float'         => '团队认养业绩只能为数字',
        'fh_dsc_ry_yeji.requireIf'       => '请输入大市场认养业绩,不需要填写0!',
        'fh_dsc_ry_yeji.float'         => '大市场认养业绩只能为数字',
        'fh_market_num.requireIf'       => '请输入所需市场数,不需要填写0!',
        'fh_market_num.number'         => '所需市场数只能为数字',
        'fh_num.requireIf'       => '请输入人数,不需要填写0!',
        'fh_num.number'         => '人数只能为数字',
    ];
}
